package com.cl.blog.web.mq;

import com.cl.blog.mq.DelayMessageSender;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.Objects;

/**
 * @Author 付
 * @Date 2024-04-01 13:13
 * @Version 1.0
 * @description
 * @since 1.0
 */
@RestController
@Slf4j
@RequestMapping("/delay")
public class RabbitMqController {

//	@Autowired
//	private DelayMessageSender sender;

//	@RequestMapping("sendmsg")
//	public void sendMsg(String msg, Integer delayType) {
//		log.info("当前时间：{},收到请求，msg:{},delayType:{}", new Date(), msg, delayType);
//		sender.sendDelayMsg(msg, Objects.requireNonNull(DelayTypeEnum.getDelayTypeEnumByValue(delayType)));
//	}

	@GetMapping("/delayMsg")
	public void delayMsg2(String msg, Integer delayTime) {
		log.info("当前时间：{},收到请求，msg:{},delayTime:{}", new Date(), msg, delayTime);
//		sender.sendDelayMsg(msg, delayTime);
	}
}
